#include<stdio.h>
typedef struct date
{
	int year;
	int month;
	int day;
}DATE;

//判断闰年
int Year(int year) {
    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
        return 1; 
    } else {
        return 0; 
    }
}

int Days(DATE d) {
    int Monthday[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    int days = d.day;

    // 计算月份之前的天数
    for (int i = 1; i < d.month; i++) {
        days += Monthday[i];
    }

    //如果是闰年且月份大于等于3月，则加1
    if (Year(d.year) && d.month >2) {
        days += 1;
    }

    return days;
}

int main() {
    DATE d;

    printf("请输入日期（年 月 日）：");
    scanf("%d %d %d", &(d.year), &(d.month), &(d.day));

    int days = Days(d);

    printf("它是%d年的第%d天\n",d.year,days);

    return 0;
}